package online.sixfish.doubao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import online.sixfish.doubao.mapper.BmsFollowMapper;
import online.sixfish.doubao.model.entity.Follow;
import online.sixfish.doubao.service.IBmsFollowService;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service
@Primary
public class IBmsFollowServiceImpl extends ServiceImpl<BmsFollowMapper, Follow> implements IBmsFollowService {
    @Resource
    BmsFollowMapper bmsFollowMapper;

    @Override
    public int getFollowCount(String id) {
        return bmsFollowMapper.selectCount((new LambdaQueryWrapper<Follow>().eq(Follow::getParentId, id)));
    }
}
